import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';

/**
 * Generated class for the ShopshPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-shopsh',
  templateUrl: 'shopsh.html',
})
export class ShopshPage {
  shops:any;
  constructor(public navCtrl: NavController, public navParams: NavParams,private busi:BusiProvider) {

  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ShopshPage');
  }

  ionViewDidEnter(){
    this.getWshShops();
  }
  getWshShops(){
    this.busi.getWshShops().subscribe(
      data=>{
        this.shops = data.shops;
      },error=>{

      }
    );
  }
  gotoshopDeail(shop){
    this.navCtrl.push("ShopdetailPage",{shop:shop});
  }

}
